package lyh;

/**
 * 功能
 * 作者：lyh
 * 日期：2024/7/12 14:02
 */
public class Student {
    private int id;
    private String name;
    private int age;
    private String sex;
    private int score;
    private static int number=0;

    public Student() {
        this.id = ++number;
    }

    public Student(String name, int age, String sex, int score) {
        this.id = ++number;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.score = score;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public static int getNumber() {
        return number;
    }

    public static void setNumber(int number) {
        Student.number = number;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", score=" + score +
                '}';
    }
}
